#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
    int maxPower(string& s) {
        char pre = '\0';
        int count = 0;
        int tmp = 0;
        for (const auto& ch : s)
        {
            if (pre != ch)
            {
                pre = ch;
                count = count > tmp ? count : tmp;
                tmp = 1;
            }
            else
                tmp++;
        }
        return count;
    }
};
int main()
{
	string s = "leetcode";
    cout << Solution().maxPower(s) << endl;
	return 0;
}